@echo off
REM chcp 936 > nul
REM setlocal enabledelayedexpansion

set "ProjectRoot=%cd%"

if exist "%ProjectRoot%\Binaries" (
    rd /s /q "%ProjectRoot%\Binaries"
)
if exist "%ProjectRoot%\Intermediate" (
    rd /s /q "%ProjectRoot%\Intermediate"
)
if exist "%ProjectRoot%\Saved" (
    rd /s /q "%ProjectRoot%\Saved"
)
if exist "%ProjectRoot%\DerivedDataCache" (
    rd /s /q "%ProjectRoot%\DerivedDataCache"
)

for /r "%ProjectRoot%\Plugins" %%i in (.) do (
    if exist "%%i\Binaries" (
        rd /s /q "%%i\Binaries"
    )
    if exist "%%i\Intermediate" (
        rd /s /q "%%i\Intermediate"
    )
)

REM pause
echo Clean up completed

echo on

git submodule init

git submodule update --progress --init --remote --recursive

git pull


pause